package com.ruoyi.account.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.AccountItemChannleHisMapper;
import com.ruoyi.db.domain.AccountItemChannleHis;
import com.ruoyi.account.service.IAccountItemChannleHisService;
import com.ruoyi.common.core.text.Convert;

/**
 * 渠道账户流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-02
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class AccountItemChannleHisServiceImpl implements IAccountItemChannleHisService 
{
    @Autowired
    private AccountItemChannleHisMapper accountItemChannleHisMapper;

    /**
     * 查询渠道账户流水
     * 
     * @param id 渠道账户流水主键
     * @return 渠道账户流水
     */
    @Override
    public AccountItemChannleHis selectAccountItemChannleHisById(Long id)
    {
        return accountItemChannleHisMapper.selectAccountItemChannleHisById(id);
    }

    /**
     * 查询渠道账户流水列表
     * 
     * @param accountItemChannleHis 渠道账户流水
     * @return 渠道账户流水
     */
    @Override
    public List<AccountItemChannleHis> selectAccountItemChannleHisList(AccountItemChannleHis accountItemChannleHis)
    {
        return accountItemChannleHisMapper.selectAccountItemChannleHisList(accountItemChannleHis);
    }

    /**
     * 查询渠道账户流水列表
     *
     * @param accountItemChannleHis 渠道账户流水
     * @return 渠道账户流水
     */
    @Override
    public List<Map<String, Object>> selectAccountItemChannleHisListMap(AccountItemChannleHis accountItemChannleHis)
    {
        return accountItemChannleHisMapper.selectAccountItemChannleHisListMap(accountItemChannleHis);
    }

    /**
     * 新增渠道账户流水
     * 
     * @param accountItemChannleHis 渠道账户流水
     * @return 结果
     */
    @Override
    public int insertAccountItemChannleHis(AccountItemChannleHis accountItemChannleHis)
    {
        accountItemChannleHis.setCreateTime(DateUtils.getNowDate());
        return accountItemChannleHisMapper.insertAccountItemChannleHis(accountItemChannleHis);
    }

    /**
     * 修改渠道账户流水
     * 
     * @param accountItemChannleHis 渠道账户流水
     * @return 结果
     */
    @Override
    public int updateAccountItemChannleHis(AccountItemChannleHis accountItemChannleHis)
    {
        return accountItemChannleHisMapper.updateAccountItemChannleHis(accountItemChannleHis);
    }

    /**
     * 批量删除渠道账户流水
     * 
     * @param ids 需要删除的渠道账户流水主键
     * @return 结果
     */
    @Override
    public int deleteAccountItemChannleHisByIds(String ids)
    {
        return accountItemChannleHisMapper.deleteAccountItemChannleHisByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除渠道账户流水信息
     * 
     * @param id 渠道账户流水主键
     * @return 结果
     */
    @Override
    public int deleteAccountItemChannleHisById(Long id)
    {
        return accountItemChannleHisMapper.deleteAccountItemChannleHisById(id);
    }
}
